#include <stdio.h>
// 计算数组中所有元素的和以及平均数
int main()
{
  int arr[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  int all_length = sizeof arr;
  int length = sizeof arr[0];
  int num = all_length / length, sum = 0;
  double avr;
  for (int i = 0; i < num; i++)
  {
    sum += arr[i];
  }
  avr = (double)sum / (double)num;
  printf("这个数组共%d个数字,总和为%d,平均值为%.2f", num, sum, avr);
  return 0;
}